var express = require('express');
var router = express.Router();
const users = require('../Schema/userinfo')
/* GET users listing. */
router.get('/logins', function (req, res, next) {
  console.log(req.query);
  let { username, password } = req.query;
  users.findOne({ username, password })
    .then(document => document ? res.send({ code: 0 }) : res.send({ code: 1 }))
    .catch(() => res.send({ code: 1 }))
});

module.exports = router;
